<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			var f={name:"夹竹桃",price:44.6,showName:function(){
				alert(this.name+","+this.price);
			}};
			f.showName();
			//多个对象   json
			var flowers=[
			{name:"玫瑰",price:{small:3.5,big:6,superbig:9.9},showName:function(){alert(this.name+","+this.price);}}
			,{name:"月季",price:[{city:"shanghai",price:6.7},{city:"hefei",price:1.5},{city:"beijing",price:9.9}],showName:function(){alert(this.name+","+this.price);}}
			,{name:"蔷薇",price:2.4,showName:function(){alert(this.name+","+this.price);}}
			,{name:["向日葵","xiangrikui","葵花盘子"],price:0.4,showName:function(){alert(this.name+","+this.price);}}
			,{name:"芍药",price:5.4,showName:function(){alert(this.name+","+this.price);}}
			
			];
			
			
			for(var i=0;i<flowers.length;i++){
				flowers[i].price+=5;
				//flowers[i].showName();
			}
			alert(JSON.stringify(flowers));
			var str="{\"name\":\"laoliu\",\"age\":29}";
			//alert(str.name);
			var t=JSON.parse(str);
			alert(t.name+","+t.age);
			
		</script>
	</head>
	<body>
	</body>
</html>
